Electronic devices and in particular portable consumer devices such as smartphones and tablet computers are prone to accidental exposure to liquid or moisture that causes a short circuit, especially at their external connectors. A portable device may become wet for example when exposed to rain, when accidentally dropped in water, or having been subjected to its user's sweat in the case of a wearable portable device. Dye-based liquid contact indicators are available that when exposed to moisture show a visible mark, and these indicators have been installed within the portable device and are visible from the outside of the device. This allows a technician to easily inspect the status of the indicator to determine whether or not the device has been exposed to liquid. Alternatively, or in addition, a liquid contact sensing circuit may be provided within the device that makes measurements across designated, internal electrodes, such as resistance and capacitance measurements, in order to detect the presence of liquid on those electrodes. Corrective actions may be taken in real time, in response to liquid detection, for example by powering down certain sensitive electronic components in the device. With respect to the external ports or connectors, the power being supplied to a port may be reduced or even terminated, such that the voltage across the electrical contacts of a port of the device is reduced or dropped to zero, in response to having detected the presence of short-circuit causing moisture adjacent to the port or within the port.